package com.uzai.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 免单指令Key类型
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum MdRobotCmdKeyEnum {
    WAKEUPCMD("WakeUpCmd","唤醒指令"),

    ;
    private String key;
    private String desc;

    MdRobotCmdKeyEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static MdRobotCmdKeyEnum getByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (MdRobotCmdKeyEnum type: MdRobotCmdKeyEnum.values()) {
            if (type.getKey().equals(key)) {
                return type;
            }
        }
        return null;
    }
}
